/*    */ package com.zimbra.cs.account.ldap;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.StringUtil;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class LdapGalCredential
/*    */ {
/*    */   String mAuthMech;
/*    */   String mBindDn;
/*    */   String mBindPassword;
/*    */   String mKrb5Principal;
/*    */   String mKrb5Keytab;
/*    */   
/*    */   public LdapGalCredential(String authMech, String bindDn, String bindPassword, String krb5Principal, String krb5Keytab)
/*    */     throws ServiceException
/*    */   {
/* 36 */     if (StringUtil.isNullOrEmpty(authMech)) {
/* 37 */       if ((bindDn != null) && (bindPassword != null)) {
/* 38 */         authMech = "simple";
/*    */       } else {
/* 40 */         authMech = "none";
/*    */       }
/*    */     }
/* 43 */     if (!authMech.equals("none"))
/*    */     {
/* 45 */       if (authMech.equals("simple")) {
/* 46 */         if ((bindDn == null) || (bindPassword == null))
/* 47 */           throw ServiceException.INVALID_REQUEST("missing bindDn or bindPassword for LDAP GAL auth mechenism " + authMech, null);
/* 48 */       } else if (authMech.equals("kerberos5")) {
/* 49 */         if ((krb5Principal == null) || (krb5Keytab == null))
/* 50 */           throw ServiceException.INVALID_REQUEST("missing krb5Principal or krb5Keytab for LDAP GAL auth mechenism " + authMech, null);
/*    */       } else
/* 52 */         throw ServiceException.INVALID_REQUEST("invalid LDAP GAL auth mechenism " + authMech, null);
/*    */     }
/* 54 */     this.mAuthMech = authMech;
/* 55 */     this.mBindDn = bindDn;
/* 56 */     this.mBindPassword = bindPassword;
/* 57 */     this.mKrb5Principal = krb5Principal;
/* 58 */     this.mKrb5Keytab = krb5Keytab;
/*    */   }
/*    */   
/*    */   public String getAuthMech() {
/* 62 */     return this.mAuthMech;
/*    */   }
/*    */   
/*    */   public String getBindDn() {
/* 66 */     return this.mBindDn;
/*    */   }
/*    */   
/*    */   public String getBindPassword() {
/* 70 */     return this.mBindPassword;
/*    */   }
/*    */   
/*    */   public String getKrb5Principal() {
/* 74 */     return this.mKrb5Principal;
/*    */   }
/*    */   
/*    */   public String getKrb5Keytab() {
/* 78 */     return this.mKrb5Keytab;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/ldap/LdapGalCredential.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */